# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=wlroots
pkgver=0.18.1
pkgrel=0
pkgdesc="Modular Wayland compositor library"
url="https://gitlab.freedesktop.org/wlroots/wlroots"
license="MIT"
arch="all"
makedepends="
	eudev-dev
	glslang-dev
	hwdata-dev
	libcap-dev
	libdisplay-info-dev
	libinput-dev
	libseat-dev
	libxcb-dev
	libxkbcommon-dev
	mesa-dev
	meson
	ninja
	pixman-dev
	vulkan-loader-dev
	wayland-dev
	wayland-protocols
	xcb-util-image-dev
	xcb-util-renderutil-dev
	xcb-util-wm-dev
	xkeyboard-config-dev
	xwayland-dev
	"
# wlroots >= 0.18.0 does no longer ship a libwlroots.so symlink in the -dev
# subpackage. Hence, abuild's dependency tracing fails to identify that the
# -dev subpackage depends on the origin package and we need to add that
# manually. Otherwise, the wlroots shared object is not installed with -dev.
depends_dev="$pkgname=$pkgver-r$pkgrel"
subpackages="$pkgname-dbg $pkgname-dev"
source="https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/$pkgver/wlroots-$pkgver.tar.gz"
options="!check" # no test suite

build() {
	abuild-meson \
		-Db_lto=true \
		-Dexamples=false \
		. build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
e906046d46fc3a64bd76caa73c5d455bf6ccc7806cff1bea5526f8c9950d69703af1d14ce01fa953d7077e71262abf58f3c58da42002f75b7f9db594fab7ad5e  wlroots-0.18.1.tar.gz
"
